<template>
  <div class="hello">
    <h1>{{ msg }}</h1>
    <h2>生成二维码</h2>
    <p>
      请选择营业厅:
    <el-select v-model="value" placeholder="请选择营业厅">
      <el-option
        v-for="item in options"
        :key="item.value"
        :label="item.label"
        :value="item.value">
      </el-option>
    </el-select>
    </p>
    <p>
      输入座位信息:
    <el-input
      size="medium"
      style="width: 140px"
      placeholder="请输入座位信息"
      v-model="input2">
    </el-input>
    </p>
    <p>
      <span>选择的营业厅代码为: {{ value }} 座位信息为 {{input2}}</span>
    </p>
    <ul>
      <li>
        <a
          href="https://vuejs.org"
          target="_blank"
        >
          Core Docs
        </a>
      </li>
      <li>
        <a
          href="https://forum.vuejs.org"
          target="_blank"
        >
          Forum
        </a>
      </li>
      <li>
        <a
          href="https://chat.vuejs.org"
          target="_blank"
        >
          Community Chat
        </a>
      </li>
      <li>
        <a
          href="https://twitter.com/vuejs"
          target="_blank"
        >
          Twitter
        </a>
      </li>
      <br>
      <li>
        <a
          href="http://vuejs-templates.github.io/webpack/"
          target="_blank"
        >
          Docs for This Template
        </a>
      </li>
    </ul>
    <h2>Ecosystem</h2>
    <div class="qrcode" ref="qrCodeUrl"></div>
  </div>
</template>

<script>
import QRCode from 'qrcodejs2'
export default {
  name: 'HelloWorld',
  methods: {
    creatQrCode () {
      var qrcode = new QRCode(this.$refs.qrCodeUrl, {
        text: 'xxxx', // 需要转换为二维码的内容
        width: 100,
        height: 100,
        colorDark: '#000000',
        colorLight: '#ffffff',
        correctLevel: QRCode.CorrectLevel.H
      })
    }
  },
  data () {
    return {
      options: [{
        value: '选项1',
        label: '青岛营业厅'
      }, {
        value: '选项2',
        label: '济南营业厅'
      }, {
        value: '选项3',
        label: '蚵仔煎'
      }, {
        value: '选项4',
        label: '龙须面'
      }, {
        value: '选项5',
        label: '北京烤鸭'
      }],
      value: '',
      input2: '',
      msg: '叫号系统测试'
    }
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h1, h2 {
  font-weight: normal;
}
ul {
  list-style-type: none;
  padding: 0;
}
li {
  display: inline-block;
  margin: 0 10px;
}
a {
  color: #42b983;
}
</style>
